package com.ych.modules.base.service;

import com.baomidou.mybatisplus.service.IService;
import com.ych.modules.base.dbEntity.TUserAccountEntity;

import java.math.BigDecimal;

/**
 * Created with IntelliJ IDEA.
 * Author: Usopp.tsui
 * Date: 2020/12/12
 * Time: 10:45
 * Description:
 */
public interface ITUserAccountService extends IService<TUserAccountEntity> {
    /**
     * 针对账盘表行级锁更新,解决并发数据紊乱
     *
     * @param entity
     * @return
     */
    boolean updateByEntity(TUserAccountEntity entity);

    /**
     * 账户金币金额变动
     *
     * @param accountTrendType          资金走向类型 收入：10000001 支出：10000002
     * @param accountChangeBusinessType 业务表指向类型 account_change_business_type码值
     * @param userId                    操作钱包用户id
     * @param payAmount                 操作金额
     * @param businessId                业务id
     */
    void alterGoldCoinAmount(String accountTrendType, String accountChangeBusinessType, String userId, String businessId, BigDecimal payAmount);

    /**
     * 账户佣金金额变动
     *
     * @param accountTrendType          资金走向类型 收入：10000001 支出：10000002
     * @param accountChangeBusinessType 业务表指向类型 account_change_business_type码值
     * @param userId                    操作钱包用户id
     * @param businessId                业务id
     * @param amount                    操作金额
     */
    void alterBrokerageAmount(String accountTrendType, String accountChangeBusinessType, String userId, String businessId, BigDecimal amount);
}
